package com.cmcc.zysoft.infocollection.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cmcc.zysoft.infocollection.dao.ReadNoticeDao;
import com.cmcc.zysoft.infocollection.model.ReadNews;
import com.starit.common.dao.hibernate.HibernateBaseDao;
import com.starit.common.dao.service.BaseServiceImpl;
@Service
public class ReadNoticeService extends BaseServiceImpl<ReadNews, String> {
	@Resource
	private ReadNoticeDao readNewDao;

	@Override
	public HibernateBaseDao<ReadNews, String> getHibernateBaseDao() {
		
		return this.readNewDao;
	}
	
	public int recordCount(String newsId,String userId){
		return this.readNewDao.count(newsId,userId);
	}
	
	public void saveReadNews(String newsId,String userId) {
		  this.readNewDao.saveReadNews(newsId, userId);
	}
	
	/**
	 * 删除指定id的记录
	 * @param newsId
	 */
	public void deleteReadNews(String newsId) {
	      this.readNewDao.delete(newsId);
	}
	

	/**
	 * 保存readNews
	 * @param readNews
	 */
	public void save(ReadNews readNews){
		this.readNewDao.save(readNews);
	}
	

	/**
	 * 查出指定newsId 的ReadNews
	 */
	 public  List<ReadNews> queryReadNewById(String newsId){
		 return this.readNewDao.queryReadNewById(newsId);
		 
	 }
	
}
